package com.example.jacky.android_easeui.base;

import android.app.Activity;

import com.example.jacky.android_easeui.utils.Jump2ActivityUtils;


public class BaseActivity extends SwipeBackActivity {
    protected Jump2ActivityUtils mJumpOperation;


    public Jump2ActivityUtils getJumpOperation() {
        if (mJumpOperation == null) {
            synchronized (Jump2ActivityUtils.class) {
                if (mJumpOperation == null) {
                    mJumpOperation = new Jump2ActivityUtils(this);
                }
            }
        }
        return mJumpOperation;
    }

    public void forward(Class<? extends Activity> targetActivity) {
        getJumpOperation().forward(targetActivity);
    }

    public void forwardAndFinish(Class<? extends Activity> targetActivity) {
        getJumpOperation().forward(targetActivity);
        finish();
    }
}
